//
// Author: Vladimir Migashko <migashko@gmail.com>, (C) 2011
//
// Copyright: See COPYING file that comes with this distribution
//

#ifndef HITLIST_HITLIST_REQUEST_JSON_HPP
#define HITLIST_HITLIST_REQUEST_JSON_HPP

#include <fas/misc/json.hpp>
#include <fas/misc/command/basic_command.hpp>

#include "names.hpp"
#include "hitlist_request.hpp"

namespace aj = ::fas::json;
namespace ap = ::fas::pattern;


/** @typedef json-сериалиатор для hitlist_request::type_t */
typedef ap::type_list_n<
  aj::enum_value<n_hits_m, hitlist_request::type_t, hitlist_request::hits_m>,
  aj::enum_value<n_hits_d, hitlist_request::type_t, hitlist_request::hits_d>
>::type type_enum_list;

/** @typedef json-сериалиатор для hitlist_request */
typedef
  aj::object<
    hitlist_request,
    ap::type_list_n<
      aj::member<n_type, hitlist_request, hitlist_request::type_t, &hitlist_request::type, 
                 aj::enumerator< hitlist_request::type_t, type_enum_list> >,
      aj::member<n_id,  hitlist_request, user_id_t  , &hitlist_request::first_id>,
      aj::member<n_offset,  hitlist_request, size_t, &hitlist_request::offset>,
      aj::member<n_limit, hitlist_request, size_t, &hitlist_request::limit>
    >::type
  > hitlist_request_json;

#endif

